package sc.web.action.demo;


import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import sc.core.model.demo.SpringBindQuery;
import sc.web.action.common.BaseAction;


@Controller
public class SpringBindAction extends BaseAction {
	@RequestMapping(value = "/demo/springbind.htm", method = RequestMethod.GET)
	public String springBindGet(SpringBindQuery query, ModelMap model) {
		return "/demo/springbind";
	}

	@RequestMapping(value = "/demo/springbind.htm", method = RequestMethod.POST)
	public String springBindPost(SpringBindQuery query, String str, int num,
			ModelMap model) {
		if (query == null)
			query = new SpringBindQuery();
		model.addAttribute(ERROR_MESSAGE, "query.str[" + query.getStr()
				+ "],query.num[" + query.getNum() + "],str[" + str + "],num["
				+ num + "]");
		return "/demo/springbind";
	}
}
